﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Domotica.Windows.Controls;
using Domotica.Windows.Input;

namespace Domotica.GazeDemo
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class DemoWindow : GazeWindow
    {
        public DemoWindow()
        {
            InitializeComponent();
            this.Closing += new System.ComponentModel.CancelEventHandler(DemoWindow_Closing);
        }

        void DemoWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            GazeDevice.Current.Stop();
        }

        public override void OnFaceMove(Domotica.Gazing.GazeEventArgs e)
        {
            Point p = this.PointFromScreen(e.Position);
            if (p.X < Width / 2)
            {
                image1.Visibility = Visibility.Visible;
                image2.Visibility = Visibility.Collapsed;
            }
            else
            {
                image1.Visibility = Visibility.Collapsed;
                image2.Visibility = Visibility.Visible;
            }
        }
    }

   
}
